/*
 提供所有chart的基础配置
 */
(function ($) {
    /* 折柱图*/
    $.lineBarOption = {
        title: {
            x: 'center',
            y: 10,
            textStyle: {
                color: '#fff',
                fontSize: 22,
                fontWeight: 500
            }
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                label: {
                    backgroundColor: '#283b56'
                }
            }
        },
        legend: {
            top: 6,
            right: 60,
            textStyle: {
                color: '#fff',
                fontSize: 14
            },
            orient: 'vertical'
        },
        grid: {
            show: false,
            left: 60,
            bottom: 20,
            right: 60,
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                boundaryGap: true,
                axisLabel: {
                    color: '#fff',
                    fontSize: 14,
                    rotate: -90
                },
                axisLine: {
                    lineStyle: {
                        color: '#4d545a',
                        width: 1
                    }
                },
                axisTick: {
                    show: false
                }
            }
        ],
        yAxis: [
            {
                show: true,
                type: 'value',
                axisLabel: {
                    color: '#fff',
                    fontSize: 14
                },
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#4d545a',
                        width: 1
                    }
                }
            }
        ],
        series: [{},{},{}]
    };
    /* 水平柱状图 */
    $.horizontalOption = {
        title: {
            x: 'center',
            y: 10,
            textStyle: {
                color: '#fff',
                fontSize: 24,
                fontWeight: 500
            }
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                label: {
                    backgroundColor: '#283b56'
                }
            }
        },
        legend: {
            show: false
        },
        grid: {
            show: false,
            left: 60,
            bottom: 60,
            right: 60,
            containLabel: true
        },
        yAxis: [
            {
                type: 'category',
                boundaryGap: true,
                axisLabel: {
                    color: '#fff',
                    fontSize: 14
                },
                axisLine: {
                    lineStyle: {
                        color: '#4d545a',
                        width: 1
                    }
                },
                axisTick: {
                    show: false
                }
            }
        ],
        xAxis: [
            {
                show: true,
                type: 'value',
                axisLabel: {
                    color: '#fff',
                    fontSize: 14
                },
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#4d545a',
                        width: 1
                    }
                }
            }
        ],
        series: []
    };
    /* 饼图 */
    $.pieChart = {
        title: {
            x: 'center',
            y: 'bottom',
            textStyle: {
                color: '#fff',
                fontSize: 20,
                fontWeight: 0
            }
        },
        legend: {
            top: 'center',
            right: 20,
            textStyle: {
                color: '#fff',
                fontSize: 14
            },
            orient: 'vertical',
            itemGap: 20,
            data: []
        },
        tooltip: {
            trigger: 'item'
        },
        label: {
            fontSize: 16
        },
        series: [
            {
                name: '',
                type: 'pie',
                radius: [0, 100],
                center: ['40%', '50%'],
                roseType: 'radius',
                data: []
            }
        ],
        color: ['#fefb4c', '#12e7f7', '#be40a1', '#db603f', '#c8ff80']
    };
})(jQuery);